package game.helper;

import game.entity.AbsSprite;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.math.Rectangle;

public class Input implements InputProcessor {
	AbsSprite absSprite;

	public Input(AbsSprite _absSprite) {
		absSprite = _absSprite;
	}

	@Override
	public boolean keyDown(int keycode) {
		return false;
	}

	@Override
	public boolean keyUp(int keycode) {
		return false;
	}

	@Override
	public boolean keyTyped(char character) {
		return false;
	}

	@Override
	public boolean touchDown(int x, int y, int pointer, int button) {
		Rectangle rectangle = new Rectangle(absSprite.getBoundingRectangle());
		if ((rectangle.contains(x, y)) & (Gdx.input.isTouched()))
			return true;
		return false;
	}

	@Override
	public boolean touchUp(int x, int y, int pointer, int button) {
		return false;
	}

	@Override
	public boolean touchDragged(int x, int y, int pointer) {
//		Rectangle rectangle = new Rectangle(absSprite.getBoundingRectangle());
//		if ((rectangle.contains(x, y)) & (Gdx.input.isTouched())){
//			absSprite.setPosition(x, y);
//			return true;
//		}
		return false;
	}

	@Override
	public boolean touchMoved(int x, int y) {
		return false;
	}

	@Override
	public boolean scrolled(int amount) {
		return false;
	}

}
